// src/types/auth.ts
export interface User {
  id: string;
  username: string;
  email: string;
  avatar?: string;
  roles?: string[];
  createdAt?: string;
}

export interface LoginData {
  username: string;
  password: string;
  rememberMe?: boolean;
}

export interface RegisterData {
  username: string;
  email: string;
  password: string;
  confirmPassword: string;
}

export interface AuthResponse {
  user: User;
  token: string;
  expiresIn: number;
}
export interface RefreshTokenResponse {
  token: string;
  expiresIn?: number; // 新的过期时间（秒）
}

export interface ErrorResponse {
  code: number;
  message: string;
  error?: string;
}